<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta http-equiv="X-UA-Compatible" content="ie=edge">
		<script src="vue/vue.js"></script>
		<script src="https://cdn.bootcss.com/vue-resource/1.5.1/vue-resource.js"></script>
		<title>Document</title>
	</head>

	<body>
		<div class="box">
			<input type="button" value="get请求" @click="getInfo">
			<input type="button" value="post请求" @click="postInfo">
			<input type="button" value="jsonp请求" @click="jsonpInfo">
		</div>
		<script>
			var vm = new Vue({
				el: '.box',
				data: {},
				methods: {
					getInfo() {
						this.$http.get('data/data.php').then(function(result) {
							console.log(result.body.data);
						})
					},
					postInfo() {
						this.$http.post('data/data.php',{},{emulateJSON:true}).then(function(result) {
							console.log(result.body.data);
						})
					},
					jsonpInfo() {
						this.$http.jsonp('data/data.php').then(function(result) {
							console.log(result.body.data);
						})
					}
				}
			})
		</script>
	</body>

</html>